<?php
//$strThumbPath = "./images/thumbz/";
//$strDefaultPath = "./images/default/";
//Picture size set in CSS

	echo "
	<ul class='productimages'>";
	//Loop through directory and echo results into a list
if(is_dir($strThumbPath)){
	$strHandle=opendir($strThumbPath);
	while ($strFile = readdir($strHandle)) {
		//if($strHandle){
			$strExt=strtolower(substr($strFile,-3,3));
			
			//if file is a jpg and page number is in file name e.g page57item1picture2.jpg 
			//product17148picture1.jpg
			if(($strExt=="jpg") && (substr($strFile,7,strpos($strFile,"picture") - 7) == $intProductID)){
				echo "
					<li>";?>
						<?php
						echo "
						<img src='./images/product/thumbz/".$strFile."'  border='0' alt=\"".$myrow["ProductName"]."\">";

						if($SCREEN == "EnterProduct"){
							echo "</br>&nbsp;</br><a href='" . ScreenURL("EnterProduct",array('ACTION'=>'actDeleteProductPicture','strPhoto'=>$strFile,'intProductID'=>$myrow[0]) ) . "' target='_blank'>Delete Picture</a>";	
						}
						echo "
						<br/>
					</li>";

			}
		//}
	}
}
	echo "
	</ul>";
	
	/*
	 * 						<a href="javascript:;" onclick="MM_openBrWindow('<?php echo ScreenURL("EnterProductPictures",array('intProductID'=>$intProductID));?>','Edit Product Pictures','scrollbars=no,menubar=no,toolbar=yes,width=400,height=500') ">
	 * 						<br/><?php echo $strFile."</a>";
	 */
?>